from src.guy import *

team_name_list = []
class Team():
    def __init__(self, team_num):
        self.id = team_num
        self.name = ''
        self.member_id = []
        self.member_name = []

    def random_name(self):
        a = ['地狱', '天堂', '黑暗', '快乐', '彩虹', '旋转']
        b = ['车', '狼狗', '之光']
        tmp = random.choice(a) + random.choice(b)
        timer = 0
        while tmp in team_name_list:
            # print('触发姓名的重随机。')
            tmp = random.choice(a) + random.choice(b) + '队'
            timer += 1
            if timer > 10:
                # print('姓名随机失败。')
                tmp = tmp + str(self.id)
                break
        self.name = tmp
        team_name_list.append(tmp)

    def add_member(self, guy = Guy):
        self.member_id.append(guy.id)
        self.member_name.append(guy.name)